﻿<!DOCTYPE html>
<html><head><meta charset="UTF-8">
<title></title>

<script>
	/*
	var stu = {
		sno : 1666
	};
	
	var test = function(){
		console.log(this);
	}.bind(stu);
	
	window.test();
	*/
	onload= function(){
		btn.onclick = function(){
			setTimeout(function(){ 
				this.innerText = "已点击"; 
			}.bind(this),2000)
		}
	}
	
	var arr = [2,34,19,40,99,38,23];
	console.log( arr.indexOf(44) );
	
	var list = [10000,12000,12000,15000,16000,19000];
	
	//forEach
	//[10000,12000,12000,15000,16000,19000].forEach(console.log);
	
	//map
	/*
	console.log(list.map(function(item){
		return item*1.1;
	}));
	*/
	
	//reduce
	console.log(list.reduce(function(itema,itemb,index,array){
		return itema + itemb;
	}));
		
	//filter
</script>
</head>
<body>
	<button id="btn">未点击</button>
</body>
</html>